翻訳と辞書
Words near each other
・ Shropshire Union Canal
・ Shropshire Union Canal Society
・ Shropshire Union Railways and Canal Company
・ Shropshire Wanderers F.C.
・ Shropshire Warriors
・ Shropshire Way
・ Shropshire Wildlife Trust
・ Shropshire Women cricket team
・ Shropshire Yeomanry
・ Shropshire Youth Theatre
・ Shroud
・ Shroud (comics)
・ Shroud (disambiguation)
・ Shroud (novel)
・ Shrinking cities in the United States
Shrinking generator
・ Shrinking Man
・ Shrinking space
・ Shrinking the Blob
・ Shrinking the footprint
・ Shrinking Violet
・ Shrinking Violet (album)
・ Shrinkwrapped
・ Shrinkwrapped (album)
・ Shrinky Dinks
・ Shrink–swell capacity
・ Shripad
・ Shripad Amrit Dange
・ Shripad Dabholkar
・ Shripad Damodar Satwalekar


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Shrinking generator : ウィキペディア英語版
Shrinking generator

In cryptography, the shrinking generator is a form of pseudorandom number generator intended to be used in a stream cipher. It was published in Crypto 1993 by Don Coppersmith, Hugo Krawczyk, and Yishay Mansour.
The shrinking generator uses two linear feedback shift registers. One, called the A sequence, generates output bits, while the other, called the S sequence, controls their output. Both A and S are clocked; if the S bit is 1, then the A bit is output; if the S bit is 0, the A bit is discarded, nothing is output, and we clock the registers again. This has the disadvantage that the generator's output rate varies irregularly, and in a way that hints at the state of S; this problem can be overcome by buffering the output.
Despite this simplicity, there are currently no known attacks better than exhaustive search when the feedback polynomials are secret. If the feedback polynomials are known, however, the best known attack requires less than A•S bits of output.〔Caballero-Gil, P. et al. (New Attack Strategy for the Shrinking Generator ) ''Journal of Research and Practice in Information Technology'', Vol. 41, No. 2, May 2009.〕
An interesting variant is the self-shrinking generator.
==An implementation of a shrinking generator in Python==

This example uses two Galois LFRSs to produce the output pseudorandom bitstream. The python code can be used to encrypt and decrypt a file or any bytestream.

#!/usr/bin/python
import sys
# ----------------------------------------------------------------------------
# Crypto4o functions start here
# ----------------------------------------------------------------------------
class glfsr:
def __init__(self, polynom, initial_value):
self.polynom = polynom | 1
self.data = initial_value
tmp = polynom
self.mask = 1
while tmp != 0:
if tmp & self.mask != 0:
tmp = tmp ^ self.mask;
if tmp == 0:
break
self.mask = self.mask << 1
def next_state(self):
self.data = self.data << 1
retval = 0
if self.data & self.mask != 0:
retval = 1
self.data = self.data ^ self.polynom
return retval
class sprng:
def __init__(self, polynom_d, init_value_d, polynom_c, init_value_c):
self.glfsr_d = glfsr(polynom_d, init_value_d)
self.glfsr_c = glfsr(polynom_c, init_value_c)
def next_byte(self):
byte = 0
bitpos = 7
while 1 == 1:
bit_d = self.glfsr_d.next_state()
bit_c = self.glfsr_c.next_state()
if bit_c != 0:
bit_r = bit_d
byte = byte | (bit_r << bitpos)
bitpos = bitpos - 1
if bitpos < 0:
break
return byte
# ----------------------------------------------------------------------------
# Crypto4o functions end here
# ----------------------------------------------------------------------------
def main():
prng = sprng(int(sys.argv(), 16), int(sys.argv(), 16),
int(sys.argv(), 16), int(sys.argv(), 16))
print "GLFSR D0: using polynom 0x%X, initial value: 0x%X." % (int(sys.argv(), 16), int(sys.argv(), 16))
print "GLFSR C0: using polynom 0x%X, initial value: 0x%X." % (int(sys.argv(), 16), int(sys.argv(), 16))
f = open(sys.argv(), "rb")
g = open(sys.argv(), "wb")
while 1 == 1:
input_ch = f.read(1)
if input_ch == "":
break
random_ch = prng.next_byte() & 0xff
g.write(chr(ord(input_ch) ^ random_ch))
f.close()
g.close()
main()

The C code is also available, see External links.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Shrinking generator」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.